<template>
	<div>
		<el-row>
			<el-col>
				<el-form :inline="true" :model="searchForm" style="margin-left: 30px; margin-top: 20px; width: 80%; float: left">
					<el-form-item label="名称" size="small">
						<el-input v-model="searchForm.name"></el-input>
					</el-form-item>
					<el-form-item label="编号" size="small">
						<el-input v-model="searchForm.code"></el-input>
					</el-form-item>
					<el-form-item>
						<el-button type="primary" @click="query">查询</el-button>
					</el-form-item>
				</el-form>
			</el-col>
		</el-row>
		<el-row style="margin-left: 20px">
			<el-table :data="tableData" border stripe style="width: 98%" row-key="id" size="small">
				<el-table-column prop="name" label="组织名称" align="center"></el-table-column>
				<el-table-column prop="code" label="组织编号" align="center"></el-table-column>
				<el-table-column prop="type" label="组织类型" align="center"></el-table-column>
				<el-table-column prop="parentCode" label="上级组织编号" align="center"></el-table-column>
				<el-table-column prop="address" label="地址" align="center"></el-table-column>
				<el-table-column prop="contact" label="联系方式" align="center"></el-table-column>
				<el-table-column prop="chargePerson" label="负责人" align="center"></el-table-column>
			</el-table>
		</el-row>
	</div>
</template>
<script>
import { deptList } from '@/api/system/dept';
export default {
	data() {
		return {
			searchForm: {},
			tableData: []
		};
	},
	mounted() {
		this.query();
	},
	methods: {
		query() {
			deptList(this.searchForm).then((res) => {
				this.tableData = res.rows;
			});
		}
	}
};
</script>
